<template> </template>
<script>
import Menu from '../../data/menu'
export default {
  name: 'index',
  data() {
    return {};
  },
  computed: {
    loginInfo() {
      return this.$store.getters.getLoginInfo;
    },
    home() {
      return '/'+this.$store.getters.getGlobalTheme;
    }
  },
  methods: {
    isAuthenticated() {
      const isLogin = !!this.loginInfo;
      // TODO 判断用户是否超时
      if (isLogin) {
        // me.$store .dispatch('buildLoginInfo')
        //   .then((res) => {
        //     me.$router.push({ path: this.home });
        //   })
        //   .catch((e) => {});
        this.$router.push({ path: this.home });
      } else {
        this.$router.push({ path: '/login' });
      }
    },
  },
  created() {
    this.isAuthenticated();
  },
  mounted() {
  },
};
</script>

<style scoped></style>
